package com.controller.admin;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.entity.Wall;
import com.service.WallService;
import com.vo.LayuiPageVo;

@Controller
public class WallController {
	@Autowired 
	private WallService wallService;
	 
	/**
     * 后台分页查看告白墙列表
     * 1.前端传入页码、分页数量
     * 2.查询分页数据
     */
    @ResponseBody
    @GetMapping("/admwall/queryall")
    public LayuiPageVo queryAllNews(int limit, int page) {
        List<Wall> walls = wallService.queryAllWalls((page - 1) * limit, limit);
        Integer dataNumber = wallService.LookWallCount();
        return new LayuiPageVo("",0,dataNumber,walls);
    }
}
